package com.dd.cloud.user.service.pres;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dd.cloud.user.entity.pres.DrugsDiscount;

import java.math.BigDecimal;

/**
 * @author Lx
 * @version 1.0
 */
public interface IDrugsDiscountService extends IService<DrugsDiscount> {
    /**
     * 获取用户药品折扣比例
     *
     * @param userId
     * @param userType
     * @return
     */
    Integer getDrugsDiscount(Integer userId, Integer userType);

    /**
     * 价格以及折扣比例计算折扣价
     *
     * @param price
     * @param discount
     * @return
     */
    Double computeDiscountPrice(Double price, Integer discount);

    /**
     * 价格以及折扣比例计算折扣价
     *
     * @param price
     * @param discount
     * @return
     */
    BigDecimal computeDiscountPrice(BigDecimal price, Integer discount);
}
